import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
import menu_model from "./model/menu.js"
import role_model from "./model/role.js"
import user_model from "./model/user.js"
import cate_model from "./model/category.js"
import specs_model from "./model/specs.js"
import goods_model from "./model/goods.js"
import seck_model from "./model/seckill"

export default new Vuex.Store({
    state: {
        nav_list: []
    },
    mutations: {
        navListMutations(state) {
            const navList = JSON.parse(localStorage.getItem("loginData") || '{}');
            if (navList) {
                state.nav_list = navList.menus
            }
        }
    },
    actions: {},
    modules: {
        menu_model: menu_model,
        role_model: role_model,
        user_model: user_model,
        cate_model: cate_model,
        specs_model: specs_model,
        goods_model: goods_model,
        seck_model: seck_model,
    }
})